cmake_minimum_required(VERSION 3.0.0)
project(libunwinder_x64 VERSION 0.1.0 LANGUAGES C CXX ASM)

include(CTest)
enable_testing()
include_directories(include)
set_property(SOURCE getcontext_x86_64.S APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp")
add_executable(
libunwinder_x64
main.cpp
dfx_log.cpp
dfx_instr_statistic.cpp
dfx_accessors.cpp
arm_exidx.cpp
dfx_elf.cpp
dfx_regs_arm.cpp
dfx_symbols.cpp
dfx_elf_parser.cpp
dfx_regs_arm64.cpp
dfx_instructions.cpp
dfx_signal.cpp
unwinder_config.cpp
dfx_memory.cpp
arch_util.cpp
dwarf_section.cpp
dfx_log.cpp
dfx_frame_formatter.cpp
dwarf_cfa_instructions.cpp
dfx_map.cpp
dfx_ark.cpp
dfx_config.cpp
dfx_ptrace.cpp
dfx_regs.cpp
dfx_regs_x86_64.cpp
unwinder.cpp
dfx_maps.cpp
dwarf_op.cpp
dfx_regs_riscv64.cpp
dfx_mmap.cpp
dfx_util.cpp
getcontext_x86_64.S)
target_compile_definitions(libunwinder_x64 PRIVATE __x86_64__ is_linux)
target_link_libraries(libunwinder_x64 dl pthread)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
